﻿using System;

namespace Batman.Core
{
    [AttributeUsage(AttributeTargets.Class)]
    public class MethodControlAttribute : Attribute
    {
        /// <summary>
        /// 是否允许获取分页方法
        /// </summary>
        public bool PageMethod { get; set; }

        /// <summary>
        /// 是否允许新建数据方法
        /// </summary>
        public bool CreateMethod { get; set; }

        /// <summary>
        /// 是否允许更新方法
        /// </summary>
        public bool UpdateMethod { get; set; }

        /// <summary>
        /// 是否允许删除方法
        /// </summary>
        public bool DeleteMethod { get; set; }


        public MethodControlAttribute(bool page = false, bool create = false, bool update = false, bool delete = false)
        {
            this.PageMethod = page;
            this.UpdateMethod = update;
            this.CreateMethod = create;
            this.DeleteMethod = delete;
        }
    }
}
